<template>
  <div>
    <el-page-header @back="goBack" content="盘点记录详情" style="color:#3198ff"></el-page-header>
    <div style="margin-top: 50px;">
      <el-table
        ref="multipleTable"
        border
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
      >
        <el-table-column prop="skuName" label="商品名称"></el-table-column>
        <el-table-column prop="stock" label="库存量"></el-table-column>
        <el-table-column prop="checkNum" label="实际盘点数量"></el-table-column>
        <!-- <el-table-column prop="changeNum" label="实际增减数量"></el-table-column> -->
      </el-table>
      <div class="pagination">
        <el-pagination
          background
          @current-change="currentPageChange"
          layout="prev, pager, next"
          :total="total"
        ></el-pagination>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "",
  data() {
    return {
      param: {
        data: {
          checkId: ""
        },
        queryRequest: {
          pageNum: 1,
          pageSize: 10
        }
      },
      tableData: [],
      total: 1,
    };
  },
  components: {},
  computed: {},
  beforeMount() {},
  mounted() {
    this.param.data.checkId = this.$route.query.id;
    this.initData();
  },
  methods: {
    initData(){
       this.$service.commoditycheckSelectCommCheck(this.param).then(res => {
        if (res.code == "00000") {
          this.tableData = res.data.rows;
          this.total = res.data.total || 0;
        }
      });
    },
    goBack() {
      this.$router.back();
    },
    handleSelectionChange(val) {},
    currentPageChange(e) {
      this.param.queryRequest.pageNum = e;
      this.initData();
    }
  },
  watch: {}
};
</script>
<style scoped>
</style>